//************************查询卡信息回掉函数******************************************************
function queryCard(json){
	if(json.statusCode==DWZ.statusCode.error){
		navTabAjaxDone(json)
	}else{
		var content="";
		$(json).each(function(n,item){
			var numPerPage=item.numPerPage;
			var currentPage=item.currentPage;
			var totalCount=item.totalCount;
			var pageCount=item.pageCount
			var list=item.list;
			if(list.length==0){
				content+="<tr><td colspan='13' align='center' >未查询到数据</td></tr>"
			}else{
				for(var i=0;i<list.length;i++){
					var applyNet="";
					var applyDate="";
					var cardDate="";
					var releaseDate="";
					var logoutDate="";
					if(list[i].collBranchNameSingle!=null){
						applyNet=list[i].collBranchNameSingle
					}
					if(list[i].collBranchNameBatch!=null){
						applyNet=list[i].collBranchNameBatch
					}
					if(list[i].crtDate!=null){
						applyDate=getDate(list[i].crtDate)
					}
					if(list[i].cardDate!=null){
						cardDate=getDate(list[i].cardDate)
					}
					if(list[i].releaseDate!=null){
						releaseDate=getDate(list[i].releaseDate)
					}
					if(list[i].logoutDate!=null){
						logoutDate=getDate(list[i].logoutDate)
					}
					var customerName="",paperNo="",paperTypeName="";
					if(list[i].customerName!=null){
						customerName=list[i].customerName;
						paperNo=list[i].paperNo;
						paperTypeName=list[i].paperTypeName;
					}
					var citizenCardNo="";
					if(list[i].citizenCardNo!=null){
						citizenCardNo=list[i].citizenCardNo;
					}
					var value=list[i].paperType+","+list[i].paperNo+","+list[i].cardPCode+","+list[i].cardStautsCode;
					content+="<tr onmouseover='moveoverMouse(this)' onmouseout='moveoutMouse(this)' align='center'><td><a href='queryInfo/cardInfo/' onclick='return openDialog(this)'>"+
					citizenCardNo+"<input hidden value="+value+">"+"</a></td><td>"+list[i].cardPName+"</td><td>"+customerName+"</td><td>"+paperTypeName+"</td><td>"+
					paperNo+"</td><td>"+list[i].cardStauts+"</td><td>"+list[i].cardPosition+"</td><td>"+applyNet+"</td><td>"+applyDate+"</td><td>"+cardDate+"</td><td>"+releaseDate+"</td><td>"+logoutDate+"</td></tr>"
				}
			}
			$("#tbodyByQueryCardInfo").html(content);
			$("input[name='numPerPage']").val(numPerPage);
			$("input[name='pageNum']").val(currentPage); 
//			$("input[name='pageCount']").val(pageCount);
			$("#totalCountByQueryCardInfo").text("条，共"+totalCount+"条");
//			var pagination="<a href='#' onclick="+"previous($('#queryCard'),queryCard) id='previous' >上一页  </a><a href='#' onclick="+"next($('#queryCard'),queryCard) id='next'> 下一页</a><span>当前第"+currentPage+"页，共"+pageCount+"页</span>";
//			$("#paginationByQueryCardInfo").html(pagination);
			$("#paginationByQueryCardInfo").addClass("pagination").attr("targetType","navTab").attr("totalCount",totalCount).attr("numPerPage",numPerPage).attr("pageNumShown","10").attr("currentPage",currentPage).attr("rel","tbodyByQueryCardInfo").attr("callback","queryCard");
			$("div.pagination").each(function(){
				var $this = $(this);
				$this.pagination({
					targetType:"navTab",
					rel:"tbodyByQueryCardInfo",
					totalCount:totalCount,
					numPerPage:numPerPage,
					pageNumShown:10,
					currentPage:currentPage,
					callback:queryCard
				});
			});
			var $p = $("#ByQueryCardInfo");
			initUI($p);
		});
	}
	
}
//****************************************打开dialog*********************************************
function openDialog(a){
	var parm=$(a).text();
	if($(a).children().val()!=undefined){
		parm=parm+","+$(a).children().val();
//		alert($(a).children().val().split(",")[0])
		if($(a).children().val().split(",")[0]=="null"){
			alertMsg.warn("空白卡无个人信息")
			return false;
		}
		if($(a).children().val().split(",")[0]=="2"){
			alertMsg.warn("空白卡任务无个人信息")
			return false;
		}
	}
	
	var url=$(a).attr("href");
	var options={"width":"1000","height":"500","parm":parm};
	$.pdialog.open(url,"infos", "详细信息",options); 
	return false;
}
//****************************************dialog显示信息*********************************************
function getDetailedInfo(json){
	if(json.statusCode==DWZ.statusCode.error){
		navTabAjaxDone(json)
	}else{
		$(json).each(function(n,item){
			$("input[name='customerName']").val(item.personal.customerName);
			$("input[name='paperType']").val(item.personal.paperType);
			$("input[name='paperNo']").val(item.personal.paperNo);
			if(item.personal.gender=="01"||item.personal.gender.indexOf("男")!=-1){
				$("input[value='01']").attr("checked",true);
			}
			if(item.personal.gender=="02"||item.personal.gender.indexOf("女")!=-1){
				$("input[value='02']").attr("checked",true);
			}
			$("input[name='nationality']").val(item.personal.nationality);
			if(item.personal.nationality=="1"){
				$("input[name='nationality']").val('汉');
			}
			$("input[name='birthday']").val(getDate(item.personal.birthday));
			$("input[name='contactAddrDetailedInfo']").val(item.personal.contactAddrDetailedInfo);
			$("input[name='homePhone']").val(item.personal.homePhone);
			$("input[name='mobile']").val(item.personal.mobile);
			$("input[name='contactPostalcode']").val(item.personal.contactPostalcode);
			$("input[name='corpName']").val(item.personal.corpName);
	//****************************************************************************
			$("input[name='cardpName']").val(item.cardDetailedVo.cardPName);
			$("input[name='citizenCardNo']").val(item.cardDetailedVo.citizenCardNo);
			$("input[name='bcNo']").val(item.cardDetailedVo.bcNo);
			$("input[name='cardStatus']").val(item.cardDetailedVo.cardStatusName);
			$("input[name='cardPosition']").val(item.cardDetailedVo.cardPositionName);
	//*****************************************************************************
			$("input[name='applyDate']").val(getDate(item.cardDetailedVo.applyDate));
			$("input[name='cardTaskNo']").val(item.cardDetailedVo.cardTaskNo);
			$("input[name='applyNet']").val(item.cardDetailedVo.applyNet)
			if(item.cardDetailedVo.reissueDate!=null){
				$("input[name='reissueDate']").val(getDate(item.cardDetailedVo.reissueDate));
				$("input[name='reissueNet']").val(item.cardDetailedVo.reissueNet)
			}
			if(item.cardDetailedVo.supplementCardDate!=null){
				$("input[name='SupplementCardDate']").val(getDate(item.cardDetailedVo.supplementCardDate));
			}
			if(item.cardDetailedVo.changeCardDate!=null){
				$("input[name='changeCardDate']").val(getDate(item.cardDetailedVo.changeCardDate));
			}
			if(item.cardDetailedVo.logoutDate!=null){
				$("input[name='logoutDate']").val(getDate(item.cardDetailedVo.logoutDate));
			}
			
	//*******************************************************************************
			if(item.cardDetailedVo.cardStatus!="0"){
				if(item.FeeRules!=null){
					$("input[name='feeBlnStatus']").val("已收");
					$("input[name='feeBln']").val(item.FeeRules.feeBln.toFixed(2));
				}else{
					if(item.cardDetailedVo.cardPCode=="15"||item.cardDetailedVo.cardPCode=="16"){
						$("input[name='feeBlnStatus']").val("无");
						$("input[name='feeBln']").val(0.00);
					}else{
						alertMsg.warn("此卡收费类型未定义")
					}
					
				}
				var list=item.list;
				var content;
				if(list.length==0){
					content+="<tr><td colspan='16' align='center' >无押金数据</td></tr>"
				}else{
					for(var i=0;i<list.length;i++){
						if(i==0){
							$("input[name='mainaccountNo']").val(list[i].mainaccountNo);
						}
						var acType="";
						acType=list[i].acType =="01"?"电子存折":"电子钱包";
						content+="<tr onmouseover='moveoverMouse(this)' onmouseout='moveoutMouse(this)' align='center'><td width='27%'>"+
						list[i].subaccountNo+"</td><td width='13%'>"+getDate(list[i].accoDate)+"</td><td width='12%'>"+acType+"</td><td width='12%'>"+list[i].appFlag+"</td><td width='12%'>"+
						list[i].crdBalance.toFixed(2)+"</td><td width='12%'>"+list[i].totalBalance.toFixed(2)+"</td><td width='12%' rowspan='2'>"+list[i].feeBln+"</td></tr>"
						
					}
				}
							
				$("#acountDetailInfo").html(content);
			}
			var $p = $("#ByCardDetailInfo");
			initUI($p);
		});
	}	
}

//**********************单笔申领部分******************************************************************
function queryApplication(json){
	if(json.statusCode==DWZ.statusCode.error){
		navTabAjaxDone(json)
	}else{
		var content="";
		$(json).each(function(n,item){
			var numPerPage=item.numPerPage;
			var currentPage=item.currentPage;
			var totalCount=item.totalCount;
			var pageCount=item.pageCount
			var list=item.list;
			//alert(numPerPage+","+currentPage+","+totalCount);
			if(list.length==0){
				content+="<tr><td colspan='13' align='center' >未查询到数据</td></tr>"
			}else{
				for(var i=0;i<list.length;i++){
					var applyDate="";
					var releaseDate="";
					var releaseNet="";
					var releasePeople="";
					var releaseOperator="";
					var citizenCardNo="";
					if(list[i].applyDate!=null){
						applyDate=getDate(list[i].applyDate)
					}
					if(list[i].citizenCardNo!=null){
						releaseNet=list[i].releaseCollBranch
						releasePeople=list[i].cardPeople
						releaseOperator=list[i].releaseOperator
						citizenCardNo=list[i].citizenCardNo
					}
					if(list[i].releaseDate!=null){
						releaseDate=getDate(list[i].releaseDate)
					}else{
						releaseDate=""
					}
					
					content+="<tr onmouseover='moveoverMouse(this)' onmouseout='moveoutMouse(this)' align='center'><td width='10%'>"+
					citizenCardNo+"</td><td>"+list[i].cardPName+"</td><td>"+list[i].customerName+"</td><td>"+list[i].paperTypeName+"</td><td>"+
					list[i].paperNo+"</td><td>"+list[i].cardStauts+"</td><td>"+list[i].cardPosition+"</td><td>"+list[i].claimStatus+"</td><td>"+
					list[i].collBranchName+"</td><td>"+applyDate+"</td><td>"+list[i].crtOperator+"</td><td>"+
					releasePeople+"</td><td>"+releaseDate+"</td><td>"+releaseOperator+"</td></tr>"
				}
			}
			$("#tbodyByQueryApplication").html(content);
			$("input[name='numPerPage']").val(numPerPage);
			$("input[name='pageNum']").val(currentPage); 
			//$("input[name='pageCount']").val(pageCount);
			$("#totalCountByQueryApplication").text("条，共"+totalCount+"条");
			
			//var pagination="<a href='#' onclick="+"previous($('#queryApplication'),queryApplication) id='previous' >上一页  </a><a href='#' onclick="+"next($('#queryApplication'),queryApplication) id='next'> 下一页</a><span>当前第"+currentPage+"页，共"+pageCount+"页</span>";
			//$("#paginationByQueryApplication").html(pagination);
			$("#paginationByQueryApplication").addClass("pagination").attr("targetType","navTab").attr("totalCount",totalCount).attr("numPerPage",numPerPage).attr("pageNumShown","10").attr("currentPage",currentPage).attr("rel","tbodyByQueryApplication").attr("callback","queryApplication");
			$("div.pagination").each(function(){
				var $this = $(this);
				$this.pagination({
					targetType:"navTab",
					rel:"tbodyByQueryApplication",
					totalCount:totalCount,
					numPerPage:numPerPage,
					pageNumShown:10,
					currentPage:currentPage,
					callback:queryApplication
				});
			});	
			var $p = $("#ByQueryAPP");
			initUI($p);
		});
	}
}

//*******************批量申领************************************************************************
function queryBatchApplication(json){
	if(json.statusCode==DWZ.statusCode.error){
		navTabAjaxDone(json)
	}else{
		var content="";
		$(json).each(function(n,item){
			var numPerPage=item.numPerPage;
			var currentPage=item.currentPage;
			var totalCount=item.totalCount;
			var pageCount=item.pageCount
			var list=item.list;
			//alert(numPerPage+","+currentPage+","+totalCount);
			if(list.length==0){
				content+="<tr><td colspan='13' align='center' >未查询到数据</td></tr>"
			}else{
				for(var i=0;i<list.length;i++){
					var applyDate="";
					var releaseDate="";
					var releaseOperator="";
					var dataSendDate="";
					var backRecDate="";
					var taskStatus="";
					if(list[i].applyDate!=null){
						applyDate=getDate(list[i].applyDate)
					}
					if(list[i].releaseDate!=null){
						releaseDate=getDate(list[i].releaseDate);
						releaseOperator=list[i].releaseOperator;
					}
					if(list[i].dataSendDate!=null){
						dataSendDate=getDate(list[i].dataSendDate);
					}
					if(list[i].backRecDate!=null){
						backRecDate=getDate(list[i].backRecDate);
					}
					if(list[i].taskStatus!=null){
						taskStatus=list[i].taskStatus
					}
					
					content+="<tr onmouseover='moveoverMouse(this)' onmouseout='moveoutMouse(this)' align='center'><td>"+
					list[i].cardPName+"</td><td>"+list[i].corpName+"</td><td>"+list[i].applyDateCollBranch+"</td><td>"+applyDate+"</td><td>"+
					list[i].applyNum+"</td><td>"+taskStatus+"</td><td>"+dataSendDate+"</td><td>"+backRecDate+"</td><td>"+
					releaseDate+"</td><td>"+releaseOperator+"</td></tr>"
				}
			}
			$("#tbodyByQueryBatchApplication").html(content);
			$("input[name='numPerPage']").val(numPerPage);
			$("input[name='pageNum']").val(currentPage); 
//			$("input[name='pageCount']").val(pageCount);
			$("#totalCountByQueryBatchApplication").text("条，共"+totalCount+"条");
//			var pagination="<a href='#' onclick="+"previous($('#queryBatchApplication'),queryBatchApplication) id='previous' >上一页  </a><a href='#' onclick="+"next($('#queryBatchApplication'),queryBatchApplication) id='next'> 下一页</a><span>当前第"+currentPage+"页，共"+pageCount+"页</span>";
//			$("#paginationByQueryApplication").html(pagination);
			$("#paginationByQueryBatchApplication").addClass("pagination").attr("targetType","navTab").attr("totalCount",totalCount).attr("numPerPage",numPerPage).attr("pageNumShown","10").attr("currentPage",currentPage).attr("rel","tbodyByQueryBatchApplication").attr("callback","queryBatchApplication");
			$("div.pagination").each(function(){
				var $this = $(this);
				$this.pagination({
					targetType:"navTab",
					rel:"tbodyByQueryBatchApplication",
					totalCount:totalCount,
					numPerPage:numPerPage,
					pageNumShown:10,
					currentPage:currentPage,
					callback:queryBatchApplication
				});
			});
			var $p = $("#ByQueryBatchApp");
			initUI($p);
		});
	}	
}

//******************制卡任务查询*******************************************************
function queryMakeCard(json){
	if(json.statusCode==DWZ.statusCode.error){
		navTabAjaxDone(json)
	}else{
		var content="";
		$(json).each(function(n,item){
			var numPerPage=item.numPerPage;
			var currentPage=item.currentPage;
			var totalCount=item.totalCount;
			var pageCount=item.pageCount;
			//20181203 hgl 增加下面一行
			var onePageCount = [numPerPage*[currentPage-1]];
			var list=item.list;
			//alert(numPerPage+","+currentPage+","+totalCount);
			if(list.length==0){
				content+="<tr><td colspan='15' align='center' >未查询到数据</td></tr>"
			}else{
				for(var i=0;i<list.length;i++){
					var tasksGeneTime="";
					var dataSendDate="";
					var batchMarkerNo="";
					var supplierCode="";
					var backRecDate="";
					var backReceiver="";
					var releaseDate="";
					var cardPeople="";
					if(list[i].tasksGeneTime!=null){
						tasksGeneTime=getDate(list[i].tasksGeneTime);
					}
					if(list[i].dataSendDate!=null){
						dataSendDate=getDate(list[i].dataSendDate);
					}
					if(list[i].batchMarkerNo!=null){
						batchMarkerNo=list[i].batchMarkerNo;
					}
					if(list[i].backRecDate!=null){
						backRecDate=getDate(list[i].backRecDate);
						backReceiver=list[i].backReceiver;
					}
					if(list[i].releaseDate!=null){
						releaseDate=getDate(list[i].releaseDate);
						cardPeople=list[i].cardPeople;
					}
					var applyBranch="";
					if(list[i].applyBranch!=null){
						applyBranch=list[i].applyBranch;
					}
					var corpName="";
					if(list[i].corpName!=null){
						corpName=list[i].corpName;
					}
					
					var value=list[i].taskType+","
					//20181203 hgl 修改下面一行
					content+="<tr onmouseover='moveoverMouse(this)' onmouseout='moveoutMouse(this)' align='center'><td><a href='queryInfo/infoByTask/' onclick='return openDialog(this)'>"+
					list[i].cardTaskNo+"<input hidden value="+value+">"+"</a></td><td>"+list[i].taskName+"</td><td>"+list[i].cardPName+"</td><td>"+list[i].taskStatus+"</td><td>"+
					applyBranch+"</td><td>"+corpName+"</td><td>"+tasksGeneTime+"</td><td>"+list[i].tasksOperator+"</td><td>"+
					dataSendDate+"</td><td>"+batchMarkerNo+"</td><td>"+list[i].companyName+"</td><td>"+
					backRecDate+"</td><td>"+backReceiver+"</td><td>"+cardPeople+"</td><td>"+releaseDate+"</td></tr>"
				}
			}
			$("#tbodyByQueryMakeCardTask").html(content);
			$("input[name='numPerPage']").val(numPerPage);
			$("input[name='pageNum']").val(currentPage); 
//			$("input[name='pageCount']").val(pageCount);
			$("#totalCountByQueryMakeCardTask").text("条，共"+totalCount+"条");
//			var pagination="<a href='#' onclick="+"previous($('#queryMakeCard'),queryMakeCard) id='previous' >上一页  </a><a href='#' onclick="+"next($('#queryMakeCard'),queryMakeCard) id='next'> 下一页</a><span>当前第"+currentPage+"页，共"+pageCount+"页</span>";
//			$("#paginationByQueryMakeCardTask").html(pagination);
			$("#paginationByQueryMakeCardTask").addClass("pagination").attr("targetType","navTab").attr("totalCount",totalCount).attr("numPerPage",numPerPage).attr("pageNumShown","10").attr("currentPage",currentPage).attr("rel","tbodyByQueryMakeCardTask").attr("callback","queryMakeCard");
			$("div.pagination").each(function(){
				var $this = $(this);
				$this.pagination({
					targetType:"navTab",
					rel:"tbodyByQueryMakeCardTask",
					totalCount:totalCount,
					numPerPage:numPerPage,
					pageNumShown:10,
					currentPage:currentPage,
					callback:queryMakeCard
				});
			});
			var $p = $("#ByMakeCardTask");
			initUI($p);
		});
	}
	
}
//****************通过任务编号dialog***************************************************
function getInfoByTaskNO(json){
	if(json.statusCode==DWZ.statusCode.error){
		navTabAjaxDone(json)
	}else{
		$(json).each(function(n,item){
			var numPerPage=item.numPerPage;
			var currentPage=item.currentPage;
			var totalCount=item.totalCount;
			var pageCount=item.pageCount;
			var cardTaskNo="";	
			var list=item.list;
			var content=""
			var i; 			
				 for(i=0;i<list.length;i++){
					 var email="";
					 if(list[i].email!=null){
						 email=list[i].email;
					 }
					content+="<tr onmouseover='moveoverMouse(this)' onmouseout='moveoutMouse(this)' align='center'><td>"+
					list[i].citizenCardNo+"</td><td>"+list[i].cardPosition+"</td><td>"+list[i].customerName+"</td><td>"+list[i].paperType+"</td><td>"+
					list[i].paperNo+"</td><td>"+list[i].gender+"</td><td>"+list[i].mobile+"</td><td>"+list[i].contactAddrDetailedInfo+"</td><td>"+email+"</td></tr>";
					if(i==0){
						cardTaskNo=list[i].cardTaskNo;
					}
				};
				$("input[name='numPerPage']").val(numPerPage);
				$("input[name='pageNum']").val(currentPage); 
//				$("input[name='pageCount']").val(pageCount);
				if(cardTaskNo!=""||cardTaskNo!=null){
					$("input[name='cardTaskNo']").val(cardTaskNo);
				}
				
				$("#totalCountByInfo").text("条，共"+totalCount+"条");
				$("#tbodyByInfo").html(content)
//				var pagination="<a href='#' onclick="+"previous($('#getInfoByTaskNO'),getInfoByTaskNO) id='previous' >上一页  </a><a href='#' onclick="+"next($('#getInfoByTaskNO'),getInfoByTaskNO) id='next'> 下一页</a><span>当前第"+currentPage+"页，共"+pageCount+"页</span>";
//				$("#paginationByInfo").html(pagination);
				$("#paginationByInfo").addClass("pagination").attr("targetType","dialog").attr("totalCount",totalCount).attr("numPerPage",numPerPage).attr("pageNumShown","10").attr("currentPage",currentPage).attr("rel","tbodyByInfo").attr("callback","getInfoByTaskNO");
				$("#paginationByInfo").each(function(){//div.pagination
					var $this = $(this);
					$this.pagination({
						targetType:"dialog",
						rel:"tbodyByInfo",
						totalCount:totalCount,
						numPerPage:numPerPage,
						pageNumShown:10,
						currentPage:currentPage,
						callback:getInfoByTaskNO
					});
				});
				var $p = $("#ByQueryInfo");
				initUI($p);
		});
	}
	
}
//*********************挂失解挂查询*******************************************************
function queryLossAndUnbind(json){
	if(json.statusCode==DWZ.statusCode.error){
		navTabAjaxDone(json)
	}else{
		var content="";
		$(json).each(function(n,item){
			var numPerPage=item.numPerPage;
			var currentPage=item.currentPage;
			var totalCount=item.totalCount;
			var pageCount=item.pageCount
			var list=item.list;
			//alert(numPerPage+","+currentPage+","+totalCount);
			if(list.length==0){
				content+="<tr><td colspan='7' align='center' >未查询到数据</td></tr>"
			}else{
				for(var i=0;i<list.length;i++){
					
					content+="<tr onmouseover='moveoverMouse(this)' onmouseout='moveoutMouse(this)' align='center'><td>"+
					list[i].cardPName+"</td><td>"+list[i].customerName+"</td><td>"+list[i].paperNo+"</td><td>"+list[i].citizenCardNo+"</td><td>"+
					getDateTime(list[i].crtDate)+"</td><td>"+list[i].branch+"</td><td>"+list[i].crtOperator+"</td><td>"+list[i].certType+"</td></tr>"
				}
			}
			$("#tbodyByQueryLossAndUnbind").html(content);
			$("input[name='numPerPage']").val(numPerPage);
			$("input[name='pageNum']").val(currentPage); 
//			$("input[name='pageCount']").val(pageCount);
			$("#totalCountByQueryLossAndUnbind").text("条，共"+totalCount+"条");
//			var pagination="<a href='#' onclick="+"previous($('#queryLossAndUnbind'),queryLossAndUnbind) id='previous' >上一页  </a><a href='#' onclick="+"next($('#queryLossAndUnbind'),queryLossAndUnbind) id='next'> 下一页</a><span>当前第"+currentPage+"页，共"+pageCount+"页</span>";
//			$("#paginationByQueryLossAndUnbind").html(pagination);
			$("#paginationByQueryLossAndUnbind").addClass("pagination").attr("targetType","navTab").attr("totalCount",totalCount).attr("numPerPage",numPerPage).attr("pageNumShown","10").attr("currentPage",currentPage).attr("rel","tbodyByQueryLossAndUnbind").attr("callback","queryLossAndUnbind");
			$("div.pagination").each(function(){
				var $this = $(this);
				$this.pagination({
					targetType:"navTab",
					rel:"tbodyByQueryLossAndUnbind",
					totalCount:totalCount,
					numPerPage:numPerPage,
					pageNumShown:10,
					currentPage:currentPage,
					callback:queryLossAndUnbind
				});
			});
			var $p = $("#ByLossAndUnbind");
			initUI($p);
		});
	}
	
}

//*****************换卡补卡查询*******************************************************************
function queryChangeAndSupplement(json){
	if(json.statusCode==DWZ.statusCode.error){
		navTabAjaxDone(json)
	}else{
		var content="";
		$(json).each(function(n,item){
			var numPerPage=item.numPerPage;
			var currentPage=item.currentPage;
			var totalCount=item.totalCount;
			var pageCount=item.pageCount
			var list=item.list;
			//alert(numPerPage+","+currentPage+","+totalCount);
			if(list.length==0){
				content+="<tr><td colspan='9' align='center' >未查询到数据</td></tr>"
			}else{
				for(var i=0;i<list.length;i++){
					var releaseDate="";
					var citizenCardNo="";
					if(list[i].releaseDate!=null){
						releaseDate=getDate(list[i].releaseDate);
					}
					if(list[i].citizenCardNo!=null){
						citizenCardNo=list[i].citizenCardNo;
					}
					content+="<tr onmouseover='moveoverMouse(this)' onmouseout='moveoutMouse(this)' align='center'><td>"+
					list[i].cardPName+"</td><td>"+list[i].customerName+"</td><td>"+list[i].paperNo+"</td><td>"+citizenCardNo+"</td><td>"+list[i].chcOriCitizenNo+"</td><td>"+
					getDate(list[i].crtDate)+"</td><td>"+list[i].branch+"</td><td>"+list[i].crtOperator+"</td><td>"+releaseDate+"</td><td>"+list[i].certType+"</td></tr>"
				}
			}
			$("#tbodyByqueryChangeAndSupplement").html(content);
			$("input[name='numPerPage']").val(numPerPage);
			$("input[name='pageNum']").val(currentPage); 
//			$("input[name='pageCount']").val(pageCount);
			$("#totalCountByqueryChangeAndSupplement").text("条，共"+totalCount+"条");
//			var pagination="<a href='#' onclick="+"previous($('#queryChangeAndSupplement'),queryChangeAndSupplement) id='previous' >上一页  </a><a href='#' onclick="+"next($('#queryChangeAndSupplement'),queryChangeAndSupplement) id='next'> 下一页</a><span>当前第"+currentPage+"页，共"+pageCount+"页</span>";
//			$("#paginationByqueryChangeAndSupplement").html(pagination);
			$("#paginationByQueryCert").addClass("pagination").attr("targetType","navTab").attr("totalCount",totalCount).attr("numPerPage",numPerPage).attr("pageNumShown","10").attr("currentPage",currentPage).attr("rel","tbodyByqueryChangeAndSupplement").attr("callback","queryChangeAndSupplement");
			$("div.pagination").each(function(){
				var $this = $(this);
				$this.pagination({
					targetType:"navTab",
					rel:"tbodyByqueryChangeAndSupplement",
					totalCount:totalCount,
					numPerPage:numPerPage,
					pageNumShown:10,
					currentPage:currentPage,
					callback:queryChangeAndSupplement
				});
			});
			var $p = $("#ByChangeAndSup");
			initUI($p);
		});
	}
	
}

//********************业务统计查询************************************************************
function queryBusinessCount(json){
	if(json.statusCode==DWZ.statusCode.error){
		navTabAjaxDone(json)
	}else{
		var content="";
		$(json).each(function(n,item){
			var numPerPage=item.numPerPage;
			var currentPage=item.currentPage;
			var totalCount=item.totalCount;
			var pageCount=item.pageCount
			var list=item.list;
			//alert(numPerPage+","+currentPage+","+totalCount);
			if(list.length==0){
				content+="<tr><td colspan='4' align='center' >未查询到数据</td></tr>"
			}else{
				for(var i=0;i<list.length;i++){
					content+="<tr onmouseover='moveoverMouse(this)' onmouseout='moveoutMouse(this)' align='center'><td>"+
					list[i].cardPName+"</td><td>"+list[i].branch+"</td><td>"+list[i].crtOperator+"</td><td>"+list[i].certType+"</td><td>"+getDate(list[i].crtDate)+"</td><td>"+list[i].num+"</td></tr>"
				}
			}
			$("#tbodyByqueryBusinessCount").html(content);
			$("input[name='numPerPage']").val(numPerPage);
			$("input[name='pageNum']").val(currentPage); 
//			$("input[name='pageCount']").val(pageCount);
			$("#totalCountByqueryBusinessCount").text("条，共"+totalCount+"条");
//			var pagination="<a href='#' onclick="+"previous($('#queryBusinessCount'),queryBusinessCount) id='previous' >上一页  </a><a href='#' onclick="+"next($('#queryBusinessCount'),queryBusinessCount) id='next'> 下一页</a><span>当前第"+currentPage+"页，共"+pageCount+"页</span>";
//			$("#paginationByqueryBusinessCount").html(pagination);
			$("#paginationByQueryBatchApplication").addClass("pagination").attr("targetType","navTab").attr("totalCount",totalCount).attr("numPerPage",numPerPage).attr("pageNumShown","10").attr("currentPage",currentPage).attr("rel","tbodyByqueryBusinessCount").attr("callback","queryBusinessCount");
			$("div.pagination").each(function(){
				var $this = $(this);
				$this.pagination({
					targetType:"navTab",
					rel:"tbodyByqueryBusinessCount",
					totalCount:totalCount,
					numPerPage:numPerPage,
					pageNumShown:10,
					currentPage:currentPage,
					callback:queryBusinessCount
				});
			});
			var $p = $("#ByBusinessCount");
			initUI($p);
		});
	}
	
}
//**************凭证查询********************************************************************
function queryCert(json){
	if(json.statusCode==DWZ.statusCode.error){
		navTabAjaxDone(json)
	}else{
		var content="";
		$(json).each(function(n,item){
			var numPerPage=item.numPerPage;
			var currentPage=item.currentPage;
			var totalCount=item.totalCount;
			var pageCount=item.pageCount
			var list=item.list;
			//alert(numPerPage+","+currentPage+","+totalCount);
			if(list.length==0){
				content+="<tr><td colspan='9' align='center' >未查询到数据</td></tr>"
			}else{
				for(var i=0;i<list.length;i++){
					var agentName="";
					var name="";
					var transName="";
					var corpName="";
					if(list[i].agentName!=null){
						agentName=list[i].agentName;
					}
					if(list[i].name!=null){
						name=list[i].name;
					}
					if(list[i].transName!=null){
						transName=list[i].transName
					}
					if(list[i].corpName!=null){
						corpName=list[i].corpName
					}
					
					content+="<tr onmouseover='moveoverMouse(this)' onmouseout='moveoutMouse(this)' align='center'><td><a  href='#' onclick='openCert(this)'>"
						+list[i].certNo+"<input hidden value="+list[i].certNo+">"+"</a></td><td>"+list[i].cardpName+"</td><td>"+name+"</td><td>"+
					agentName+"</td><td>"+transName+"</td><td>"+corpName+"</td><td>"+
					getDate(list[i].crtDate)+"</td><td>"+list[i].branch+"</td><td>"+list[i].crtOperator+"</td><td>"+list[i].certType+"</td></tr>"
				}
			}
			$("#tbodyByQueryCert").html(content);
			$("input[name='numPerPage']").val(numPerPage);
			$("input[name='pageNum']").val(currentPage); 
//			$("input[name='pageCount']").val(pageCount);
			$("#totalCountByQueryCert").text("条，共"+totalCount+"条");
//			var pagination="<a href='#' onclick="+"previous($('#queryCert'),queryCert) id='previous' >上一页  </a><a href='#' onclick="+"next($('#queryCert'),queryCert) id='next'> 下一页</a><span>当前第"+currentPage+"页，共"+pageCount+"页</span>";
//			$("#paginationByQueryCert").html(pagination);
			$("#paginationByQueryCert").addClass("pagination").attr("targetType","navTab").attr("totalCount",totalCount).attr("numPerPage",numPerPage).attr("pageNumShown","10").attr("currentPage",currentPage).attr("rel","tbodyByQueryCert").attr("callback","queryCert");
			$("div.pagination").each(function(){
				var $this = $(this);
				$this.pagination({
					targetType:"navTab",
					rel:"tbodyByQueryCert",
					totalCount:totalCount,
					numPerPage:numPerPage,
					pageNumShown:10,
					currentPage:currentPage,
					callback:queryCert
				});
			});
			var $p = $("#ByQueryCert");
			initUI($p);
		});
	}
	
}
//**************办理情况查询**********************************************************
function queryHandleInfo(json){
	if(json.statusCode==DWZ.statusCode.error){
		navTabAjaxDone(json)
	}else{
		var content="";
		$(json).each(function(n,item){
			var numPerPage=item.numPerPage;
			var currentPage=item.currentPage;
			var totalCount=item.totalCount;
			var pageCount=item.pageCount
			var list=item.list;
			//alert(numPerPage+","+currentPage+","+totalCount);
			if(list.length==0){
				content+="<tr><td colspan='10' align='center' >未查询到数据</td></tr>"
			}else{
				for(var i=0;i<list.length;i++){
					var agentName="";
					var name="";
					var transName="";
					var corpName="";
					var paperNo="";
					var citizenCardNo="";
					var claimStatus="";
					if(list[i].agentName!=null){
						agentName=list[i].agentName;
					}
					if(list[i].name!=null){
						name=list[i].name;
					}
					if(list[i].transName!=null){
						transName=list[i].transName
					}
					if(list[i].corpName!=null){
						corpName=list[i].corpName
					}
					if(list[i].paperNo!=null){
						paperNo=list[i].paperNo
					}
					if(list[i].citizenCardNo!=null){
						citizenCardNo=list[i].citizenCardNo
					}
					if(list[i].claimStatus!=null){
						claimStatus=list[i].claimStatus
					}
					
					content+="<tr onmouseover='moveoverMouse(this)' onmouseout='moveoutMouse(this)' align='center'><td>"+
					list[i].cardpName+"</td><td>"+citizenCardNo+"</td><td>"+name+"</td><td>"+paperNo+"</td><td>"+claimStatus+"</td><td>"+
					agentName+"</td><td>"+transName+"</td><td>"+corpName+"</td><td>"+
					getDate(list[i].crtDate)+"</td><td>"+list[i].branch+"</td><td >"+list[i].crtOperator+"</td><td>"+list[i].certType+"</td></tr>"
				}
			}
			$("#tbodyByQueryHandleInfo").html(content);
			$("input[name='numPerPage']").val(numPerPage);
			$("input[name='pageNum']").val(currentPage); 
//			$("input[name='pageCount']").val(pageCount);
			$("#totalCountByQueryHandleInfo").text("条，共"+totalCount+"条");
//			var pagination="<a href='#' onclick="+"previous($('#queryHandleInfo'),queryHandleInfo) id='previous' >上一页  </a><a href='#' onclick="+"next($('#queryHandleInfo'),queryHandleInfo) id='next'> 下一页</a><span>当前第"+currentPage+"页，共"+pageCount+"页</span>";
//			$("#paginationByQueryHandleInfo").html(pagination);
			$("#totalCountByQueryHandleInfo").addClass("pagination").attr("targetType","navTab").attr("totalCount",totalCount).attr("numPerPage",numPerPage).attr("pageNumShown","10").attr("currentPage",currentPage).attr("rel","tbodyByQueryHandleInfo").attr("callback","queryHandleInfo");
			$("div.pagination").each(function(){
				var $this = $(this);
				$this.pagination({
					targetType:"navTab",
					rel:"tbodyByQueryHandleInfo",
					totalCount:totalCount,
					numPerPage:numPerPage,
					pageNumShown:20,
					currentPage:currentPage,
					callback:queryHandleInfo
				});
			});
			var $p = $("#ByQueryHandInfo");
			initUI($p);
		});
	}
	
}